<%@page import="cn.lily.com.enviroment.Enviroment"%>
<%@page contentType="text/html; charset=utf-8"%>
<%@page import="cn.lily.inst.web.frames.FrameConfig"%>
<%@page import="cn.lily.web.util.context.WebContext"%>
<%@page import="cn.lily.esb.context.AuthEntity"%>
<%@page import="cn.lily.com.container.ram.ApplicationContext"%>
<%@page import="cn.lily.com.db.sql.DBManager"%>
<%@page import="app.portal.dao.Pt_app_infoBean"%>
<%@page import="app.portal.dao.Pw_app_menu_infoBean"%>
<%@page import="app.portal.util.EnumValue"%>
<%@page import="cn.lily.com.db.DBFactory"%>
<%@page import="cn.lily.com.db.container.reader.DataTable"%>
<%@ page import="cn.lily.com.configure.util.ESBSetting"%>
<%@page import="cn.lily.com.lang.VerifyData"%>
<%@ include file="/frames/logbegin.jsp" %>
<%
	String contextPath = "";
	AuthEntity authEntity = (AuthEntity) session.getAttribute(WebContext.LOG_AUTH_CONTEXT);
	if (authEntity != null) {
		contextPath = authEntity.getContextPath();
	}
	FrameConfig.setContextPath(contextPath);
	String pwAppId =authEntity.getOperEntity().getAppID();
	DBManager dbManager = DBFactory.getActionDB();
	 String sql="";
	 if(EnumValue.OPER_TYP_1.equals(authEntity.getOperEntity().getOperType())) {
		  sql=" select * from ${schema}.pw_flow_info where pw_app_id = '"+pwAppId
				  +"' and role_id in (select a.role_id from ${schema}.pw_role a where a.pw_app_id='"+pwAppId+"' and a.is_general='"+EnumValue.ROLE_IS_GENERAL_0+"') order by flow_no ";
	  }else{
		  sql=" select * from ${schema}.pw_flow_info where pw_app_id='"+pwAppId
				  +"' and role_id in (select m.role_id from ${schema}.pw_oper_role m,pw_role n where  m.role_id=n.role_id and m.oper_key='" +authEntity.getOperatorId()+"' and n.status='1') order by flow_no ";
	  }
	DataTable table = dbManager.executeQueryTable(sql);
	Integer count=table.getRecordCount();
%>
  <script src="<%=FrameConfig.getBaseJsUrl()%>common/jquery-1.9.1.min.js"></script>
  <script src="/<%=ESBSetting.getString("appCode")%>/public/js/skin_bootstrap/bootstrap-3.3.0/bootstrap-3.3.0.js"></script>
  <script src="<%=FrameConfig.getJsUrl("flowmain.js")%>"></script>
<!DOCTYPE html>
<html lang="zh-CN">
<head>
	<meta http-equiv="X-UA-Compatible" content="IE=Edge">
	<meta charset=utf-8>
	<meta name="viewport" content="width=device-width, initial-scale=1.0">
	<title><%=FrameConfig.getAppName()%></title>
	<link href="/<%=ESBSetting.getString("appCode")%>/public/style/skin_bootstrap/bootstrap-3.3.0/bootstrap.css" rel="stylesheet" media="screen">
	<link href="/<%=ESBSetting.getString("appCode")%>/public/font/awesome/font-awesome-4.7.0.css" rel="stylesheet">
	<link href="<%=FrameConfig.getCSSPath("flowmain.css") %>" rel="stylesheet" />
</head>
<body>
<div class="flow">
	<!-- <div class="title">
		&nbsp;&nbsp;&nbsp;流&nbsp;程&nbsp;引&nbsp;导
	</div> -->
	<div class="content">
		<%
		if(table.getRecordCount()>0){
		%>	
			<div class="center" count=<%=count%> >
			<%
			while(table.next()){
			%>
			<div class="btnbox01">
	    		<div class="redbg">
	        		<h1><%=table.getString("FLOW_NAM")%></h1>
	       		</div>
	       		<div class="bg">
	        		<a href="flowBranch.jsp?flowId=<%=table.getString("FLOW_ID")%>"><%=table.getString("FLOW_DES")%></a>
	        	</div>
	    	</div>
			<%
			}
			%>
			</div>
		<%
		}else{
		%>	
			<div class="message"></div>
		<%
		}
		DBFactory.free() ;
	 	%>
	 	<%@ include file="/frames/logend.jsp" %>
	</div>
</div>
</body>
</html>
  
